from flask import Flask
from flask import render_template
from config import Config

app = Flask(__name__)
app.config.from_object(Config)


@app.route('/')
@app.route('/index')
def hello_world():
    user = {'username': '王鑫'}
    posts = [
        {
            'author': {'username': 'john'},
            'body': 'beautiful day in portland!'
        },
        {
            'author': {'username': 'susan'},
            'body': 'The avengers movie was so cool!'
        }
    ]
    return render_template('index.html', title="Home", user=user, posts=posts)


if __name__ == '__main__':
    app.run(debug=True)
